Integrand size = 13, antiderivative size = 123 \[ \int x \cos \left (a+b x+c x^2\right ) \, dx=-\frac {b \sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}+\frac {b \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{2 c^{3/2}}+\frac {\sin \left (a+b x+c x^2\right )}{2 c} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3543, 3529, 3433, 3432} \[ \int x \cos \left (a+b x+c x^2\right ) \, dx=-\frac {\sqrt {\frac {\pi }{2}} b \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}+\frac {\sqrt {\frac {\pi }{2}} b \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}+\frac {\sin \left (a+b x+c x^2\right )}{2 c} \]
[In]
[Out]
Rule 3432
Rule 3433
Rule 3529
Rule 3543
Rubi steps \begin{align*} \text {integral}& = \frac {\sin \left (a+b x+c x^2\right )}{2 c}-\frac {b \int \cos \left (a+b x+c x^2\right ) \, dx}{2 c} \\ & = \frac {\sin \left (a+b x+c x^2\right )}{2 c}-\frac {\left (b \cos \left (a-\frac {b^2}{4 c}\right )\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx}{2 c}+\frac {\left (b \sin \left (a-\frac {b^2}{4 c}\right )\right ) \int \sin \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx}{2 c} \\ & = -\frac {b \sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}+\frac {b \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{2 c^{3/2}}+\frac {\sin \left (a+b x+c x^2\right )}{2 c} \\ \end{align*}
Time = 0.20 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.91 \[ \int x \cos \left (a+b x+c x^2\right ) \, dx=\frac {-b \sqrt {2 \pi } \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )+b \sqrt {2 \pi } \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )+2 \sqrt {c} \sin (a+x (b+c x))}{4 c^{3/2}} \]
[In]
[Out]
Time = 0.84 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.80
method | result | size |
default | \(\frac {\sin \left (c \,x^{2}+b x +a \right )}{2 c}-\frac {b \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {C}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {S}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}}\) | \(99\) |
risch | \(-\frac {b \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{4 c}} \operatorname {erf}\left (\sqrt {i c}\, x +\frac {i b}{2 \sqrt {i c}}\right )}{8 c \sqrt {i c}}+\frac {b \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{4 c}} \operatorname {erf}\left (-\sqrt {-i c}\, x +\frac {i b}{2 \sqrt {-i c}}\right )}{8 c \sqrt {-i c}}+\frac {\sin \left (c \,x^{2}+b x +a \right )}{2 c}\) | \(123\) |
parts | \(\frac {\sqrt {2}\, \sqrt {\pi }\, x \cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {C}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )}{2 \sqrt {c}}+\frac {\sqrt {2}\, \sqrt {\pi }\, x \sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {S}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )}{2 \sqrt {c}}-\frac {\sqrt {2}\, \sqrt {\pi }\, \left (\frac {\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \sqrt {2}\, \sqrt {\pi }\, \left (\operatorname {C}\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )-\frac {\sin \left (\frac {\pi \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2}}{2}\right )}{\pi }\right )}{2 \sqrt {c}}+\frac {\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \sqrt {2}\, \sqrt {\pi }\, \left (\operatorname {S}\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )+\frac {\cos \left (\frac {\pi \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2}}{2}\right )}{\pi }\right )}{2 \sqrt {c}}\right )}{2 \sqrt {c}}\) | \(327\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.97 \[ \int x \cos \left (a+b x+c x^2\right ) \, dx=-\frac {\sqrt {2} \pi b \sqrt {\frac {c}{\pi }} \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) - \sqrt {2} \pi b \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - 2 \, c \sin \left (c x^{2} + b x + a\right )}{4 \, c^{2}} \]
[In]
[Out]
\[ \int x \cos \left (a+b x+c x^2\right ) \, dx=\int x \cos {\left (a + b x + c x^{2} \right )}\, dx \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.63 (sec) , antiderivative size = 580, normalized size of antiderivative = 4.72 \[ \int x \cos \left (a+b x+c x^2\right ) \, dx=\frac {{\left (\left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} - \left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b^{2} \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + {\left (\left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} - \left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b^{2} \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - 2 \, {\left ({\left (-\left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} + \left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b c \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + {\left (-\left (i + 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )} + \left (i - 1\right ) \, \sqrt {2} \sqrt {\pi } {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{c}}\right ) - 1\right )}\right )} b c \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} x - 4 \, {\left (c {\left (i \, e^{\left (\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{4 \, c}\right )} - i \, e^{\left (-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{4 \, c}\right )}\right )} \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - c {\left (e^{\left (\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{4 \, c}\right )} + e^{\left (-\frac {4 i \, c^{2} x^{2} + 4 i \, b c x + i \, b^{2}}{4 \, c}\right )}\right )} \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sqrt {\frac {4 \, c^{2} x^{2} + 4 \, b c x + b^{2}}{c}}}{16 \, c^{2} \sqrt {\frac {4 \, c^{2} x^{2} + 4 \, b c x + b^{2}}{c}}} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.33 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.49 \[ \int x \cos \left (a+b x+c x^2\right ) \, dx=-\frac {\frac {i \, \sqrt {2} \sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{4} i \, \sqrt {2} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c}{4 \, c}\right )}}{{\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} + 2 i \, e^{\left (i \, c x^{2} + i \, b x + i \, a\right )}}{8 \, c} - \frac {-\frac {i \, \sqrt {2} \sqrt {\pi } b \operatorname {erf}\left (\frac {1}{4} i \, \sqrt {2} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c}{4 \, c}\right )}}{{\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} - 2 i \, e^{\left (-i \, c x^{2} - i \, b x - i \, a\right )}}{8 \, c} \]
[In]
[Out]
Timed out. \[ \int x \cos \left (a+b x+c x^2\right ) \, dx=\int x\,\cos \left (c\,x^2+b\,x+a\right ) \,d x \]
[In]
[Out]